<ui:composition template = "template.xhtml"
                xmlns ="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name ="conteudo">

        <h:form>

            <h:panelGrid columns="2">
                
                <h:outputLabel value="Nome Campo: " />
                <h:inputText value="#{novoCampoBean.campo.titulo}" />
                
                <h:outputLabel value="Descrição " />
                <h:inputText value="#{novoCampoBean.campo.descricao}" />
                
                <h:outputLabel value="Dublin Core: " />
                <h:inputText value="#{novoCampoBean.campo.dublinCore}" />
                
                <h:outputLabel value="Marc: " />
                <h:inputText value="#{novoCampoBean.campo.marc}" />
                
                <h:outputLabel value="Ajuda: " />
                <h:inputText value="#{novoCampoBean.campo.ajuda}" />
                
                <h:outputLabel value="Tipo Campo: " />
                <h:selectOneMenu value="#{novoCampoBean.tipoCampo.chaveTipoCampo}">
                    <f:selectItems value="#{novoCampoBean.listaTC}" var="tc" itemLabel="#{tc.descricao}" itemValue="#{tc.chaveTipoCampo}" />
                </h:selectOneMenu>
                
                <h:outputLabel value="Tamanho: " />
                <h:inputText value="#{novoCampoBean.campo.tamanho}" />
                
                <h:outputLabel value="Acervo Recursivo: " />
                <h:selectOneMenu value="#{novoCampoBean.acervo.chaveAcervo}">
                    <f:selectItem value="#{null}" itemLabel="-- Selecione um Acervo --" noSelectionOption="true" />
                    <f:selectItems value="#{novoCampoBean.listaAC}" var="ac" itemLabel="#{ac.descricao}" itemValue="#{ac.chaveAcervo}" />
                </h:selectOneMenu>
                
            </h:panelGrid>

            <h:commandLink value="Salvar">
                <f:ajax
                    event ="click"
                    execute ="@form"
                    listener ="#{novoCampoBean.create()}"
                    render ="@all" />
            </h:commandLink>


        </h:form>

    </ui:define>
</ui:composition>